<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.core.watchdog_sim.Watchdog</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.core-module.html">Package&nbsp;core</a> ::
        <a href="simvoc.core.watchdog_sim-module.html">Module&nbsp;watchdog_sim</a> ::
        Class&nbsp;Watchdog
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Watchdog</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_simvoc_c_60" name="uml_class_diagram_for_simvoc_c_60">
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="17,39,604,57"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#debug" title="Transmits a debugging message to the simulator debug facility" alt="" coords="17,57,604,76"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#event_pending" title="Returns: &#160;True iff a watchdog event is pending" alt="" coords="17,76,604,95"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#add_watchdog_event" title="Adds a watchdog event at the specified time." alt="" coords="17,95,604,113"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#check_watch" title="Adds a watchdog event if necessary." alt="" coords="17,113,604,132"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#set_policy" title="Adjusts the policy contained in a particular WatchRecord instance by &#160;adjusting the target and limit levels as contained in the vo_record &#160;(dictionary&#45;like object)." alt="" coords="17,132,604,151"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#add_voc" title="Adds a VOC to the watchdog for management, or changes the policy of an &#160;existing VOC." alt="" coords="17,151,604,169"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#start_voc_node" title="Starts one or more VOC nodes for a VO managed by the watchdog, using the &#160;queue scheduler as the pilot job submission target." alt="" coords="17,169,604,188"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#stop_voc_node" title="Stops one or more VOC nodes for a VO managed by the watchdog." alt="" coords="17,188,604,207"/>
<area shape="rect" id="node140" href="simvoc.core.watchdog_sim.Watchdog-class.html#watch_trigger" title="Periodic watchdog event handler that implements the naive greedy watchdog &#160;algorithm." alt="" coords="17,207,604,225"/>
<area shape="rect" id="node1" href="simvoc.core.watchdog_sim.Watchdog-class.html" title="Naive greedy watchdog implementation." alt="" coords="5,6,616,231"/>
</map>
  <img src="uml_class_diagram_for_simvoc_c_60.gif" alt='' usemap="#uml_class_diagram_for_simvoc_c_60" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Naive greedy watchdog implementation. This watchdog always tries to 
  expand the size of a VOC whenever the number of jobs waiting in the watch
  queue exceeds the number of pilot jobs running to lease resources for the
  VOC, provided that the current number of pilot jobs does not exceed a 
  specified limit level. Whenever the number of jobs waiting in the watch 
  queue falls below the size of the VOC, the watchdog will terminate pilot 
  jobs. The minimum size of a VOC (the target level) may be specified so 
  that a VOC never becomes empty.</p>
  <p>This implementation supports tracking multiple VOs and thus is usable 
  for both transparent and participating VOCs. However, only one scheduler 
  queue may be watched, and only one scheduler queue may be used as a 
  target for sending pilot jobs (both queues may be the same).</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">sim</span>,
        <span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">w_sched</span>,
        <span class="summary-sig-arg">q_sched</span>,
        <span class="summary-sig-arg">interval</span>=<span class="summary-sig-default">300</span>,
        <span class="summary-sig-arg">default_target</span>=<span class="summary-sig-default">0</span>,
        <span class="summary-sig-arg">default_limit</span>=<span class="summary-sig-default">-1</span>,
        <span class="summary-sig-arg">**kwds</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#debug" class="summary-sig-name">debug</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Transmits a debugging message to the simulator debug facility</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.debug">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#event_pending" class="summary-sig-name">event_pending</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      True iff a watchdog event is pending</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.event_pending">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#add_watchdog_event" class="summary-sig-name">add_watchdog_event</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>)</span><br />
      Adds a watchdog event at the specified time.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.add_watchdog_event">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#check_watch" class="summary-sig-name">check_watch</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Adds a watchdog event if necessary.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.check_watch">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#set_policy" class="summary-sig-name">set_policy</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">wr</span>,
        <span class="summary-sig-arg">vo_record</span>=<span class="summary-sig-default">None</span>)</span><br />
      Adjusts the policy contained in a particular WatchRecord instance by 
      adjusting the target and limit levels as contained in the vo_record 
      (dictionary-like object).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.set_policy">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#add_voc" class="summary-sig-name">add_voc</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">voc</span>,
        <span class="summary-sig-arg">vo_record</span>=<span class="summary-sig-default">None</span>)</span><br />
      Adds a VOC to the watchdog for management, or changes the policy of 
      an existing VOC.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.add_voc">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#start_voc_node" class="summary-sig-name">start_voc_node</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>,
        <span class="summary-sig-arg">count</span>=<span class="summary-sig-default">1</span>)</span><br />
      Starts one or more VOC nodes for a VO managed by the watchdog, using 
      the queue scheduler as the pilot job submission target.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.start_voc_node">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#stop_voc_node" class="summary-sig-name">stop_voc_node</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>,
        <span class="summary-sig-arg">count</span>=<span class="summary-sig-default">1</span>)</span><br />
      Stops one or more VOC nodes for a VO managed by the watchdog.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.stop_voc_node">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.watchdog_sim.Watchdog-class.html#watch_trigger" class="summary-sig-name">watch_trigger</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Periodic watchdog event handler that implements the naive greedy 
      watchdog algorithm.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.watch_trigger">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">sim</span>,
        <span class="sig-arg">name</span>,
        <span class="sig-arg">w_sched</span>,
        <span class="sig-arg">q_sched</span>,
        <span class="sig-arg">interval</span>=<span class="sig-default">300</span>,
        <span class="sig-arg">default_target</span>=<span class="sig-default">0</span>,
        <span class="sig-arg">default_limit</span>=<span class="sig-default">-1</span>,
        <span class="sig-arg">**kwds</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>sim</code></strong> - Reference to the simulator object</li>
        <li><strong class="pname"><code>name</code></strong> (str) - Name of the watchdog</li>
        <li><strong class="pname"><code>w_sched</code></strong> - Reference to the watch scheduler: this scheduler is the one whose
          queue the watchdog monitors</li>
        <li><strong class="pname"><code>q_sched</code></strong> - Reference to the queue scheduler: this scheduler is the one to 
          which pilot jobs will be submitted in order to lease additional 
          resources to expand the size of the VOC</li>
        <li><strong class="pname"><code>interval</code></strong> (number) - Watchdog interval in time units</li>
        <li><strong class="pname"><code>default_target</code></strong> (int) - Default target level to use when the VO input record does not 
          specify a target level</li>
        <li><strong class="pname"><code>default_limit</code></strong> (int) - Default limit level to use when the VO input record does not 
          specify a limit level</li>
        <li><strong class="pname"><code>kwds</code></strong> - Extra data for the watchdog</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="debug"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">debug</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.debug">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Transmits a debugging message to the simulator debug facility</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>message</code></strong> - Message to be transmitted</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="event_pending"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">event_pending</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.event_pending">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: bool</dt>
        <dd>True iff a watchdog event is pending</dd>
  </dl>
</td></tr></table>
</div>
<a name="add_watchdog_event"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_watchdog_event</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.add_watchdog_event">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a watchdog event at the specified time. Only one event may be 
  pending at any time: attempting to schedule another event will result in 
  an Exception.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Time at which event should occur</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="check_watch"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">check_watch</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.check_watch">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a watchdog event if necessary. An event is necessary if no event 
  is already pending, and either jobs are waiting in the watch scheduler 
  queue or more VOC nodes are running than required by the target 
  levels.</p>
  <dl class="fields">
    <dt>Returns: bool</dt>
        <dd>True iff a watchdog event is added to the simulation</dd>
  </dl>
</td></tr></table>
</div>
<a name="set_policy"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_policy</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">wr</span>,
        <span class="sig-arg">vo_record</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.set_policy">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adjusts the policy contained in a particular WatchRecord instance by 
  adjusting the target and limit levels as contained in the vo_record 
  (dictionary-like object). If the vo_record is None, then this method does
  nothing. Any policy changes made by this method will not have any effect 
  until the next watchdog invocation.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>wr</code></strong> - WatchRecord to adjust</li>
        <li><strong class="pname"><code>vo_record</code></strong> - VO record to use to make the adjustment</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_voc"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_voc</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">voc</span>,
        <span class="sig-arg">vo_record</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.add_voc">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a VOC to the watchdog for management, or changes the policy of an
  existing VOC.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>voc</code></strong> - Reference to the VOC to add</li>
        <li><strong class="pname"><code>vo_record</code></strong> - Instance of <a href="simvoc.core.vo_format_reader.VO-class.html" 
          class="link">vo_format_reader.VO</a>, or another dictionary-like 
          object, if available. This record may contain fields named 
          &quot;limit&quot; and &quot;target&quot;, which will be used to 
          set or change the limit and target levels for the corresponding 
          VO.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="start_voc_node"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">start_voc_node</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>,
        <span class="sig-arg">count</span>=<span class="sig-default">1</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.start_voc_node">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Starts one or more VOC nodes for a VO managed by the watchdog, using 
  the queue scheduler as the pilot job submission target.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> (str) - Name of the VO</li>
        <li><strong class="pname"><code>count</code></strong> (int) - Number of nodes to add to the VOC</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="stop_voc_node"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">stop_voc_node</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>,
        <span class="sig-arg">count</span>=<span class="sig-default">1</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.stop_voc_node">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Stops one or more VOC nodes for a VO managed by the watchdog. Note 
  that this method will NOT stop VOC nodes that are presently busy, so the 
  total number of VOC nodes that are stopped may be less than count.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> (str) - Name of the VO</li>
        <li><strong class="pname"><code>count</code></strong> (int) - Number of VOC nodes to stop</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a simulator results collection</dd>
  </dl>
</td></tr></table>
</div>
<a name="watch_trigger"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">watch_trigger</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">simobj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.watchdog_sim-pysrc.html#Watchdog.watch_trigger">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Periodic watchdog event handler that implements the naive greedy 
  watchdog algorithm. This method is invoked as a simulator event.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>simulator results collection</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:34 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
